package study.javabasic.Thread;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;

public class ThreadPoolDemo {

    public static void main(String[] args) throws ExecutionException, InterruptedException {
        ExecutorService executorService=Executors.newCachedThreadPool();
      Future<String> task=  executorService.submit(new MyCallable());

      if (!task.isDone()){
          System.out.println("please waiting");
      }
        System.out.println(task.get());
      executorService.shutdown();
    }
}
